home *** CD-ROM | disk | FTP | other *** search
- #ifndef __TMessage__
- #define __TMessage__
-
- #include <Types.h>
- #include <Traps.h>
- #include <Files.h>
- #include <Devices.h>
-
-
- class TMessage {
- public:
- /* Constructor and destructor. Constructor will build the message
- * with the appropriate data members passed in. */
- TMessage(char *message, short senderSig, short receiverSig);
- ~TMessage();
-
- /* Two boolean functions which just query the message to see
- * if the message is destined for the signature of the
- * Requestor. Nice example of function overloading -- in the
- * one case I just wanted to return true or false, in the other
- * case I wanted to return who the message was from and the actual
- * message string. This is also nice because we only have one
- * public member function returning any private information. */
- Boolean IsMessageForMe(short sigOfRequestor);
- Boolean IsMessageForMe(short sigOfRequestor, short *senderSig, char *messageString);
-
- private:
- /* GetSenderSig returns fSenderSig.
- * SetSenderSig sets fSenderSig to signature. */
- short GetSenderSig();
- void SetSenderSig(short signature);
-
- /* GetReceiverSig returns fReceiverSig.
- * SetReceiverSig sets fReceiverSig to signature. */
- short GetReceiverSig();
- void SetReceiverSig(short signature);
-
- /* GetMessageString returns fMessageString.
- * SetMessageString sets fMessageString to msgString. */
- char *GetMessageString();
- void SetMessageString(char *msgString);
-
- // private data members. Again, we keep the storage for the string here.
- short fSenderSig;
- short fReceiverSig;
- char fMessageString[255];
- };
-
- typedef TMessage *TMessPtr;
- #endif